/*CopyRight 2015 By YXKJ Co., Ltd. All Rights Reserved.*/
package com.yx.ehis.service.impl;

import java.io.Serializable;
import java.util.List;
import org.springframework.stereotype.Service;
import com.yx.ehis.dao.BaseGeneralDAO;
import com.yx.ehis.dao.JpaGeneralDAO;
import com.yx.ehis.dao.OriginalGeneralDAO;
import com.yx.ehis.service.GeneralService;

/**
 * @author zgq
 */
@Service("generalService")
public class GeneralServiceImpl implements GeneralService {
	private BaseGeneralDAO baseGeneralDAO;

	/**
	 * 获取 baseGeneralDAO
	 * 
	 * @return baseGeneralDAO
	 */
	public BaseGeneralDAO getBaseGeneralDAO() {
		return baseGeneralDAO;
	}

	/**
	 * 设置 baseGeneralDAO
	 * 
	 * @param baseGeneralDAO
	 */
	public void setBaseGeneralDAO(BaseGeneralDAO baseGeneralDAO) {
		this.baseGeneralDAO = baseGeneralDAO;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#count(com.googlecode.genericdao.search
	 * .ISearch)
	 */
	// @Override
	// public int count(ISearch arg0) {
	// return baseGeneralDAO.count(arg0);
	// }

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#find(java.lang.Class,
	 * java.io.Serializable)
	 */
	@Override
	public <T> T find(Class<T> arg0, Serializable arg1) {
		return baseGeneralDAO.find(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#find(java.lang.Class,
	 * java.io.Serializable[])
	 */
	@Override
	public <T> T[] find(Class<T> arg0, Serializable... arg1) {
		return baseGeneralDAO.find(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#findAll(java.lang.Class)
	 */
	@Override
	public <T> List<T> findAll(Class<T> arg0) {
		return baseGeneralDAO.findAll(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#flush()
	 */
	@Override
	public void flush() {
		baseGeneralDAO.flush();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#getFilterFromExample(java.lang.Object)
	 */
	// @Override
	// public Filter getFilterFromExample(Object arg0) {
	// return baseGeneralDAO.getFilterFromExample(arg0);
	// }

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#getFilterFromExample(java.lang.Object,
	 * com.googlecode.genericdao.search.ExampleOptions)
	 */
	// @Override
	// public Filter getFilterFromExample(Object arg0, ExampleOptions arg1) {
	// return baseGeneralDAO.getFilterFromExample(arg0, arg1);
	// }

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#getReference(java.lang.Class,
	 * java.io.Serializable)
	 */
	@Override
	public <T> T getReference(Class<T> arg0, Serializable arg1) {
		return baseGeneralDAO.getReference(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#getReferences(java.lang.Class,
	 * java.io.Serializable[])
	 */
	@Override
	public <T> T[] getReferences(Class<T> arg0, Serializable... arg1) {
		return baseGeneralDAO.getReferences(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#isAttached(java.lang.Object)
	 */
	@Override
	public boolean isAttached(Object arg0) {
		return baseGeneralDAO.isAttached(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#refresh(java.lang.Object[])
	 */
	@Override
	public void refresh(Object... arg0) {
		baseGeneralDAO.refresh(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#remove(java.lang.Object)
	 */
	@Override
	public boolean remove(Object arg0) {
		return baseGeneralDAO.remove(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#remove(java.lang.Object[])
	 */
	@Override
	public void remove(Object... arg0) {
		baseGeneralDAO.remove(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#removeById(java.lang.Class,
	 * java.io.Serializable)
	 */
	@Override
	public boolean removeById(Class<?> arg0, Serializable arg1) {
		return baseGeneralDAO.removeById(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#removeByIds(java.lang.Class,
	 * java.io.Serializable[])
	 */
	@Override
	public void removeByIds(Class<?> arg0, Serializable... arg1) {
		baseGeneralDAO.removeByIds(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#save(java.lang.Object)
	 */
	@Override
	public boolean save(Object arg0) {
		return baseGeneralDAO.save(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#save(java.lang.Object[])
	 */
	@Override
	public boolean[] save(Object... arg0) {
		return baseGeneralDAO.save(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#search(com.googlecode.genericdao.search
	 * .ISearch)
	 */
	// @Override
	// public List<?> search(ISearch arg0) {
	// return baseGeneralDAO.search(arg0);
	// }

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#searchAndCount(com.googlecode.genericdao
	 * .search.ISearch)
	 */
	// @Override
	// public SearchResult<?> searchAndCount(ISearch arg0) {
	// return baseGeneralDAO.searchAndCount(arg0);
	// }

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.yx.ehis.service.GeneralService#searchUnique(com.googlecode.genericdao
	 * .search.ISearch)
	 */
	// @Override
	// public Object searchUnique(ISearch arg0) {
	// return baseGeneralDAO.searchUnique(arg0);
	// }

	private OriginalGeneralDAO originalGeneralDAO;

	/**
	 * 获取 originalGeneralDAO
	 * 
	 * @return originalGeneralDAO
	 */
	public OriginalGeneralDAO getOriginalGeneralDAO() {
		return originalGeneralDAO;
	}

	/**
	 * 设置 originalGeneralDAO
	 * 
	 * @param originalGeneralDAO
	 */
	public void setOriginalGeneralDAO(OriginalGeneralDAO originalGeneralDAO) {
		this.originalGeneralDAO = originalGeneralDAO;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#create(java.lang.Object)
	 */
	@Override
	public void create(Object arg0) {
		originalGeneralDAO.create(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#createOrUpdate(java.lang.Object)
	 */
	@Override
	public boolean createOrUpdate(Object arg0) {
		return originalGeneralDAO.createOrUpdate(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#deleteById(java.lang.Class,
	 * java.io.Serializable)
	 */
	@Override
	public boolean deleteById(Class<?> arg0, Serializable arg1) {
		return originalGeneralDAO.deleteById(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#deleteEntity(java.lang.Object)
	 */
	@Override
	public boolean deleteEntity(Object arg0) {
		return originalGeneralDAO.deleteEntity(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#fetch(java.lang.Class,
	 * java.io.Serializable)
	 */
	@Override
	public <T> T fetch(Class<T> arg0, Serializable arg1) {
		return originalGeneralDAO.fetch(arg0, arg1);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#fetchAll(java.lang.Class)
	 */
	@Override
	public <T> List<T> fetchAll(Class<T> arg0) {
		return originalGeneralDAO.fetchAll(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#isConnected(java.lang.Object)
	 */
	@Override
	public boolean isConnected(Object arg0) {
		return originalGeneralDAO.isConnected(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#refresh(java.lang.Object)
	 */
	@Override
	public void refresh(Object arg0) {
		originalGeneralDAO.refresh(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#update(java.lang.Object)
	 */
	@Override
	public void update(Object arg0) {
		originalGeneralDAO.update(arg0);
	}

	private JpaGeneralDAO jpaGeneralDAO;

	/**
	 * 获取 jpaGeneralDAO
	 * 
	 * @return jpaGeneralDAO
	 */
	public JpaGeneralDAO getJpaGeneralDAO() {
		return jpaGeneralDAO;
	}

	/**
	 * 设置 jpaGeneralDAO
	 * 
	 * @param jpaGeneralDAO
	 */
	public void setJpaGeneralDAO(JpaGeneralDAO jpaGeneralDAO) {
		this.jpaGeneralDAO = jpaGeneralDAO;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#merge(java.lang.Object)
	 */
	@Override
	public <T> T merge(T arg0) {
		return jpaGeneralDAO.merge(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#merge(java.lang.Object[])
	 */
	@Override
	public Object[] merge(Object... arg0) {
		return jpaGeneralDAO.merge(arg0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yx.ehis.service.GeneralService#persist(java.lang.Object[])
	 */
	@Override
	public void persist(Object... arg0) {
		jpaGeneralDAO.persist(arg0);
	}

}
